import { createApp } from 'vue'
// import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import store from './stores/store'

// 导入Element-plus中所有的图标组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'


//导入mock模拟
import '@/api/mock'


//导入公共组件
import Header from '@/components/Header/index.vue'
import Footer from '@/components/Footer/index.vue'
import TypeNav from '@/components/TypeNav/index.vue'

// 引入 ElementPlus 组件库
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'


const app = createApp(App)

//注册全局组件
app.component('HeaderView', Header)
app.component('FooterView', Footer)
app.component('TypeNav', TypeNav)



app.use(router)
app.use(store)
app.use(ElementPlus, {
    locale: zhCn
})

// console.log(ElementPlusIconsVue);
// console.log(Object.entries(ElementPlusIconsVue));

// ElementPlusIconsVue是一个对象
// key:图标的名字
// value:图标的配置项信息
//将Element-plus中所有的图标组件注册为全局的组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }

app.mount('#app')
